<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <style>
        .num_error{  right:0.5rem; top:0; color:#cb1448;}
    </style>
    <title>添加银行卡</title>
    <script>
        $(function($){
            //填充省份下拉选
            $.getJSON("${ctx}/ajax/get_area?parentCode=", function(json){
                //alert("JSON Data: " +json);
                //alert(json.length);
                for(var i in json){
                    //alert(json[i].areaName);
                    $("#addrProvinceCode").append("<option value='"+json[i].areaCode+"'>"+json[i].areaName+"</option>");
                }
            });
            //省份发生改变时，填充市级下拉选
            $("#addrProvinceCode").change(function () {
                //填充发货地省市名
                $("#addrProvinceName").val($("#addrProvinceCode option:selected").text());
                $("#addrCityCode option").remove();
                $("#addrCityCode").append("<option value=''>"+"请选择市"+"</option>");
                var selectTmp=$("#addrProvinceCode").val();
                if(selectTmp!=0){
                    $.getJSON("${ctx}/ajax/get_area?parentCode="+selectTmp, function(json){
                        for(var i in json){
                            //alert(json[i].areaName);
                            $("#addrCityCode").append("<option value='"+json[i].areaCode+"'>"+json[i].areaName+"</option>");}
                    });
                }
            });
            //市发生改变时
            $("#addrCityCode").change(function () {
                //填充市级名
                $("#addrCityName").val($("#addrCityCode option:selected").text());
            });
        });
    </script>
</head>
<body>
<form:form modelAttribute="UserBankcardModel" method="post"   class="text-form" name="childForm">
<article class="viewports">
    <ul class="plr20 lh1-5 mt30">
        <li class="ptb20">
            <div class="c8">
                <div class="odr2 plr10 mt20 b-ffffff">
                    <form:input path="accountName" cssClass="i_text" placeholder="开户姓名" ></form:input>
                    <%--<input class="i_text" type="text" value="" placeholder="开户姓名">--%>
                </div>
                <form:errors path="accountName" cssClass="num_error"></form:errors>
                <div class="fs24 c9 lh1 mt10">下次添加银行卡时将使用相同的开户姓名，请务必填写准确。</div>
                <div class="odr2 plr10 mt20 b-ffffff">
                    <form:input path="bank" cssClass="i_text" placeholder="开户银行" ></form:input>
                    <%--<input class="i_text" type="text" value="" placeholder="开户银行">--%>
                </div>
                <form:errors path="bank" cssClass="num_error"></form:errors>
                <div class="odr2 plr10 mt20 b-ffffff">
                    <form:select path="addrProvinceCode" class="s_text">
                        <form:option value="">--请选择省--</form:option>
                    </form:select>
                    <form:select path="addrCityCode" class="s_text">
                        <form:option value="">--请选择市--</form:option>
                    </form:select>
                    <span class="r"><i class="ico-30 ico_arrow"></i></span>
                </div>
                <form:errors path="addrProvinceCode" cssClass="num_error"></form:errors>
                <form:errors path="addrCityCode" cssClass="num_error"></form:errors>
                <div class="odr2 plr10 mt20 b-ffffff">
                    <form:input path="branch" cssClass="i_text" placeholder="支行" ></form:input>
                    <%--<input class="i_text" type="text" value="" placeholder="支行">--%>
                </div>
                <form:errors path="branch" cssClass="num_error"></form:errors>
                <div class="odr2 plr10 mt20 b-ffffff">
                    <form:input path="cardNo" cssClass="i_text" placeholder="银行卡号" ></form:input>
                    <%--<input class="i_text" type="text" value="" placeholder="银行卡号">--%>
                </div>
                <form:errors path="cardNo" cssClass="num_error"></form:errors>
            </div>
        </li>
    </ul>
    <div class="tac ptb30"><button class="i_btn b-2db22d cf r5 lh2 plr120" type="submit">保存</button></div>
</article>
</form:form>
</body>
</html>